home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / VarHelper 17995462001.psc / clsSearch.cls < prev    next >
Encoding:
Visual Basic class definition  |  2001-04-06  |  59.2 KB  |  1,546 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "clsSearch"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
  15. Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
  16.  
  17. Option Explicit
  18.  
  19. Private m_ScanDone        As Boolean
  20. Private m_VBInstance      As VBIDE.VBE
  21.  
  22. ' *******************************************************
  23. ' Routine Name : (PRIVATE in CLASS) Sub Class_Initialize
  24. ' Written By   : Mateusz Kierepka
  25. ' Programmer   : Mateusz Kierepka [MKPROG]
  26. ' Date Writen  : 02-24-2001 -- 08:43:33
  27. ' Inputs       : N/A
  28. ' Outputs      : N/A
  29. ' Description  :
  30. '              :
  31. '              :
  32. ' Called By    :
  33. ' *******************************************************
  34. Private Sub Class_Initialize()
  35.  
  36.  '{{{ Added It!
  37.  
  38.   On Error GoTo Generated_trap '}}}
  39.  
  40.   Set colVariables = New FastCollection
  41.   
  42.   '{{{ Added It!
  43.   Err.Clear
  44. Generated_trap:
  45.   If Err <> 0 Then
  46.     Select Case ToDoOnError(Err, "Class_Initialize")
  47.      Case vbRetry: Resume
  48.      Case vbIgnore: Resume Next
  49.     End Select
  50.   End If '}}}
  51.  
  52. End Sub
  53.  
  54. ' *******************************************************
  55. ' Routine Name : (PRIVATE in CLASS) Sub Class_Terminate
  56. ' Written By   : Mateusz Kierepka
  57. ' Programmer   : Mateusz Kierepka [MKPROG]
  58. ' Date Writen  : 02-24-2001 -- 08:43:27
  59. ' Inputs       : N/A
  60. ' Outputs      : N/A
  61. ' Description  :
  62. '              :
  63. '              :
  64. ' Called By    :
  65. ' *******************************************************
  66. Private Sub Class_Terminate()
  67.  
  68.  '{{{ Added It!
  69.  
  70.   On Error GoTo Generated_trap '}}}
  71.  
  72.   Set colVariables = Nothing
  73.   '{{{ Added It!
  74.   Err.Clear
  75. Generated_trap:
  76.   If Err <> 0 Then
  77.     Select Case ToDoOnError(Err, "Class_Terminate")
  78.      Case vbRetry: Resume
  79.      Case vbIgnore: Resume Next
  80.     End Select
  81.   End If '}}}
  82.  
  83. End Sub
  84.  
  85. ' *******************************************************
  86. ' Routine Name : (PRIVATE in CLASS) Sub AddCodes
  87. ' Written By   : Mateusz Kierepka
  88. ' Programmer   : Mateusz Kierepka [MKPROG]
  89. ' Date Writen  : 02-24-2001 -- 08:43:11
  90. ' Inputs       : N/A
  91. ' Outputs      : N/A
  92. ' Description  : load code to fast collection
  93. '              :
  94. '              :
  95. ' Called By    :
  96. ' *******************************************************
  97. Private Sub AddCodes()
  98.  Dim cFunction         As clsFunction
  99.  Dim vbComponentObj    As VBComponent
  100.  Dim vbMemberObj       As Member
  101.  Dim strKey            As String
  102.  Dim lngProgressCnt    As Long
  103.  Dim i                 As Long
  104.  Dim lngProcedureType  As Long
  105.  Dim strProcedureCode  As String
  106.  Dim lngBodyStart      As Long
  107.  Dim lngStartLine      As Long
  108.  Dim lngLineCount      As Long
  109.  Dim lngProcedureLineCount  As Long
  110.  '{{{ Added It!
  111.  
  112.   On Error GoTo Generated_trap '}}}
  113.  
  114.  
  115.   
  116.   Set colCodes = New FastCollection
  117.   
  118.   '
  119.   '   initialize the progres dialog
  120.   
  121.   Call frmScanProgress.InitProgress("Please Wait - collecting data...", 0, VBInstance.ActiveVBProject.VBComponents.Count - 1)
  122.   
  123.   For Each vbComponentObj In VBInstance.ActiveVBProject.VBComponents
  124.     
  125.     Call frmScanProgress.ReportProgress("Scanning " & vbComponentObj.Name & " for data.", lngProgressCnt)
  126.     
  127.     '   DO NOT Scan if this is a related document or a resource file
  128.     '   There is no CodeModule component for this types
  129.     If vbComponentObj.Type <> vbext_ct_ResFile And vbComponentObj.Type <> vbext_ct_RelatedDocument Then
  130.       With vbComponentObj
  131.       
  132.         If .CodeModule.CountOfDeclarationLines > 0 Then
  133.           
  134.           Call AddFunction(.CodeModule.Lines(1, _
  135.                .CodeModule.CountOfDeclarationLines), _
  136.                .Name, _
  137.                "")
  138.         End If
  139.         
  140.         For Each vbMemberObj In vbComponentObj.CodeModule.Members
  141.           '   The member type tells us if this is a function or a variable
  142.           
  143.           Call frmScanProgress.ReportChange("Scanning function: " & vbMemberObj.Name & " for data.")
  144.           
  145.           lngProcedureType = -1
  146.           
  147.           Select Case vbMemberObj.Type
  148.            Case vbext_mt_Method, vbext_mt_Event
  149.             lngProcedureType = vbext_pk_Proc
  150.               
  151.            Case vbext_mt_Property
  152.             '
  153.             '   This all necessary due to the fact that we have to knwo the proper type of Get/Let to use
  154.             '   We are just getting one line now because we are doing this just to test and probe
  155.             On Error Resume Next
  156.              strProcedureCode = vbComponentObj.Lines(vbComponentObj.ProcStartLine(vbMemberObj.Name, vbext_pk_Get), 1)
  157.              If Err.Number = 35 Then ' Sub or Function not defined
  158.                Err.Clear
  159.                strProcedureCode = vbComponentObj.Lines(vbComponentObj.ProcStartLine(vbMemberObj.Name, vbext_pk_Let), 1)
  160.                If Err.Number = 35 Then ' Sub or Function not defined
  161.                  Err.Clear
  162.                  strProcedureCode = vbComponentObj.Lines(vbComponentObj.ProcStartLine(vbMemberObj.Name, vbext_pk_Set), 1)
  163.                  If Err.Number = 0 Then
  164.                    lngProcedureType = vbext_pk_Set
  165.                   Else
  166.                    ' could not determine the type...
  167.                    lngProcedureType = -1
  168.                  End If
  169.                 Else
  170.                  lngProcedureType = vbext_pk_Let
  171.                End If
  172.               Else
  173.                lngProcedureType = vbext_pk_Get
  174.              End If
  175.             On Error GoTo 0
  176.           End Select
  177.           '
  178.           '   If we could not determine the type or it is not a type we wnat, skip on outta here
  179.           If lngProcedureType <> -1 Then
  180.             '
  181.             '   We are going to inspect each function as a whole for the presence
  182.             '   of any procedure calls.  To do so we need to get information about
  183.             '   the code for each procedure.
  184.             '
  185.             On Error Resume Next
  186.              '   First we will get the starting lines and line count of the procedure
  187.              lngBodyStart = vbComponentObj.CodeModule.ProcBodyLine(vbMemberObj.Name, lngProcedureType)
  188.              lngStartLine = vbComponentObj.CodeModule.ProcStartLine(vbMemberObj.Name, lngProcedureType)
  189.              lngLineCount = vbComponentObj.CodeModule.ProcCountLines(vbMemberObj.Name, lngProcedureType)
  190.              '
  191.              '   ProcCountLInes returns the number of lines INCLUDING any comments before the actual
  192.              '   start of the code.  We don't want those so we calculate a new line count which only
  193.              '   includes the actual body of code
  194.              lngProcedureLineCount = lngLineCount - (lngBodyStart - lngStartLine)
  195.              '
  196.              '   But, as we look through the code for occurances of functions, the entry point (as MS calls it)
  197.              '   will cause false hits so lets skip the first line
  198.              lngBodyStart = lngBodyStart + 1
  199.              '
  200.              '   And we might as well skip the End Sub line
  201.              lngProcedureLineCount = lngProcedureLineCount - 2
  202.                 
  203.              '   Now, let's actually get the code
  204.              '   obj.Lines (startline, count)
  205.             
  206.              Call AddFunction(vbComponentObj.CodeModule.Lines _
  207.                   (lngBodyStart, lngProcedureLineCount), _
  208.                   .Name, vbMemberObj.Name)
  209.              
  210.             On Error GoTo 0
  211.           End If
  212.           
  213.         Next vbMemberObj
  214.         
  215.         Set vbMemberObj = Nothing
  216.       End With
  217.     End If
  218.     lngProgressCnt = lngProgressCnt + 1
  219.   Next vbComponentObj
  220.    
  221.   frmScanProgress.Hide
  222.   
  223.   On Error GoTo 0
  224.   '{{{ Added It!
  225.   Err.Clear
  226. Generated_trap:
  227.   If Err <> 0 Then
  228.     Select Case ToDoOnError(Err, "AddCodes")
  229.      Case vbRetry: Resume
  230.      Case vbIgnore: Resume Next
  231.     End Select
  232.   End If '}}}
  233.  
  234. End Sub
  235.  
  236.  
  237. ' *******************************************************
  238. ' Routine Name : (PRIVATE in CLASS) Sub AddFunction
  239. ' Written By   : Mateusz Kierepka
  240. ' Programmer   : Mateusz Kierepka [MKPROG]
  241. ' Date Writen  : 02-24-2001 -- 08:43:03
  242. ' Inputs       : ByRef sCode:String -
  243. '              : ByRef sModuleName:String -
  244. '              : ByRef sFunctionName:String -
  245. ' Outputs      : N/A
  246. ' Description  :
  247. '              :
  248. '              :
  249. ' Called By    :
  250. ' *******************************************************
  251. Private Sub AddFunction(ByRef sCode As String, _
  252.                         ByRef sModuleName As String, _
  253.                         ByRef sFunctionName As String)
  254.  
  255.  '{{{ Added It!
  256.  
  257.   On Error GoTo Generated_trap '}}}
  258.                        
  259.  Dim cFunction As clsFunction
  260.  
  261.   Set cFunction = New clsFunction
  262.   With cFunction
  263.     .sCode = sCode
  264.     .sModuleName = sModuleName
  265.     .sName = sFunctionName
  266.   End With
  267.   colCodes.Add cFunction, sModuleName & sFunctionName
  268.   Set cFunction = Nothing
  269.   '{{{ Added It!
  270.   Err.Clear
  271. Generated_trap:
  272.   If Err <> 0 Then
  273.     Select Case ToDoOnError(Err, "AddFunction")
  274.      Case vbRetry: Resume
  275.      Case vbIgnore: Resume Next
  276.     End Select
  277.   End If '}}}
  278.  
  279. End Sub
  280.  
  281.  
  282. ' *******************************************************
  283. ' Routine Name : (PRIVATE in CLASS) Function CheckConst
  284. ' Written By   : Mateusz Kierepka
  285. ' Programmer   : Mateusz Kierepka [MKPROG]
  286. ' Date Writen  : 02-24-2001 -- 08:43:00
  287. ' Inputs       : ByRef sCheckThis:String -
  288. '              : ByVal bModule:Boolean -
  289. '              : ByRef sFunction:String -
  290. '              : ByRef sModuleName:String -
  291. ' Outputs      : N/A
  292. ' Description  :
  293. '              :
  294. '              :
  295. ' Called By    :
  296. ' *******************************************************
  297. Private Function CheckConst(ByRef sCheckThis As String, _
  298.                             ByVal bModule As Boolean, _
  299.                             ByRef sFunction As String, _
  300.                             ByRef sModuleName As String)
  301.  
  302.  Dim cVariable    As clsVariable
  303.  Dim sParse       As String
  304.  
  305.  Dim clsRegExp   As RegExp
  306.  Dim clsMatchCol As MatchCollection
  307.  Dim clsMatch    As Match
  308.  Dim strResult   As String
  309.  Dim strTemp     As String
  310.  Dim i           As Long
  311.  
  312.  '{{{ Added It!
  313.  
  314.   On Error GoTo Generated_trap '}}}
  315.  
  316.  
  317.   Set cVariable = New clsVariable
  318.   
  319.   Set clsRegExp = New RegExp
  320.    
  321.   strResult = sCheckThis
  322.  
  323.   '-----------------------------
  324.   'first set regular expresion
  325.   '-----------------------------
  326.   With clsRegExp
  327.     .Global = True
  328.     .IgnoreCase = True
  329.     '-----------------------------
  330.     'comments
  331.     '-----------------------------
  332.     .Pattern = "\'{1}.*"
  333.     Set clsMatchCol = .Execute(strResult)
  334.     
  335.     For Each clsMatch In clsMatchCol
  336.       With clsMatch
  337.         Debug.Print .Value
  338.         cVariable.sComment = Trim$(.Value)
  339.       End With
  340.     Next clsMatch
  341.     
  342.     strResult = .Replace(strResult, " ")
  343.     '-----------------------------
  344.     'remove const keyword
  345.     ' - first check maybe there
  346.     '   are more then 1 const
  347.     '   declaration
  348.     '-----------------------------
  349.     .Pattern = "\s?(const){1}\s"
  350.     Set clsMatchCol = .Execute(strResult)
  351.     
  352.     '-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  353.     ' ! -> R E C U R E N C Y if more const then 1 <- !
  354.     '-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  355.     If clsMatchCol.Count > 1 Then
  356.       
  357.       Call CheckConst(Right$(sCheckThis, Len(sCheckThis) - _
  358.            (clsMatchCol.Item(0).FirstIndex + clsMatchCol.Item(0).Length)), bModule, _
  359.            sFunction, sModuleName)
  360.       sCheckThis = Left$(sCheckThis, clsMatchCol.Item(0).FirstIndex)
  361.     End If
  362.     
  363.     If clsMatchCol.Count = 0 Then
  364.       Exit Function
  365.     End If
  366.     
  367.     '-----------------------------
  368.     'WithEvents
  369.     '-----------------------------
  370.     .Pattern = "\s?(withevents){1}\s"
  371.     Set clsMatchCol = .Execute(strResult)
  372.     
  373.     If clsMatchCol.Count > 0 Then
  374.       cVariable.bWithEvents = True
  375.       strResult = .Replace(strResult, " ")
  376.       '-----------------------------
  377.       'too many public
  378.       '-----------------------------
  379.       If clsMatchCol.Count > 1 Then
  380.         cVariable.sDescription = cVariable.sDescription & _
  381.                                  "Too many WithEvents keyword in const declaration." & vbCrLf
  382.       End If
  383.      Else
  384.       cVariable.bWithEvents = False
  385.     End If
  386.     
  387.     '-----------------------------
  388.     'public with
  389.     '-----------------------------
  390.     .Pattern = "\s?(public){1}\s"
  391.     Set clsMatchCol = .Execute(strResult)
  392.     
  393.     If clsMatchCol.Count > 0 Then
  394.       cVariable.sScope = "public"
  395.       strResult = .Replace(strResult, " ")
  396.       '-----------------------------
  397.       'too many public
  398.       '-----------------------------
  399.       If clsMatchCol.Count > 1 Then
  400.         cVariable.sDescription = cVariable.sDescription & _
  401.                                  "Too many public keyword in const declaration." & vbCrLf
  402.       End If
  403.     End If
  404.     
  405.     '-----------------------------
  406.     'private
  407.     '-----------------------------
  408.     .Pattern = "\s?(private){1}\s"
  409.     Set clsMatchCol = .Execute(strResult)
  410.     If clsMatchCol.Count > 0 Then
  411.       strResult = .Replace(strResult, " ")
  412.       '-----------------------------
  413.       'too many private
  414.       '-----------------------------
  415.       If clsMatchCol.Count > 1 Then
  416.         cVariable.sDescription = cVariable.sDescription & _
  417.                                  "Too many Private keyword in const declaration." & vbCrLf
  418.       End If
  419.       '----------------------------------------------------------
  420.       'someone declared const with private and public keyword
  421.       '----------------------------------------------------------
  422.       If Len(cVariable.sScope) > 0 Then
  423.         cVariable.sDescription = cVariable.sDescription & _
  424.                                  "Private and public keyword in const declaration." & vbCrLf
  425.         cVariable.sScope = "Error"
  426.        Else
  427.         cVariable.sScope = "Private"
  428.       End If
  429.     End If
  430.     '-----------------------------
  431.     'global
  432.     '-----------------------------
  433.     .Pattern = "\s?(global){1}\s"
  434.     Set clsMatchCol = .Execute(strResult)
  435.     If clsMatchCol.Count > 0 Then
  436.       strResult = .Replace(strResult, " ")
  437.       '-----------------------------
  438.       'too many private
  439.       '-----------------------------
  440.       If clsMatchCol.Count > 1 Then
  441.         cVariable.sDescription = cVariable.sDescription & _
  442.                                  "Too many Global keyword in const declaration." & vbCrLf
  443.       End If
  444.       '----------------------------------------------------------
  445.       'someone declared const with private and public keyword
  446.       '----------------------------------------------------------
  447.       If Len(cVariable.sScope) > 0 Then
  448.         cVariable.sDescription = cVariable.sDescription & _
  449.                                  "Global and Private or public keyword in const declaration." & vbCrLf
  450.         cVariable.sScope = "Error"
  451.        Else
  452.         cVariable.sScope = "Global"
  453.       End If
  454.       cVariable.sDescription = cVariable.sDescription & _
  455.                                "Global keyword is obslote. You should use public instead." & vbCrLf
  456.     End If
  457.     
  458.     '-----------------------------
  459.     ' Scope declared?
  460.     '-----------------------------
  461.     If Len(cVariable.sScope) = 0 Then
  462.     
  463.       cVariable.sDescription = cVariable.sDescription & _
  464.                                "You should add Private or public keyword for constant to declare scope." & vbCrLf
  465.       
  466.       If bModule Then
  467.         cVariable.sScope = "Not declared - public"
  468.        Else
  469.         cVariable.sScope = "Not declared - Private"
  470.       End If
  471.     End If
  472.     
  473.     '-----------------------------
  474.     'find type of constant
  475.     '-----------------------------
  476.     .Pattern = "\s?(as){1}\s"
  477.     Set clsMatchCol = .Execute(strResult)
  478.     
  479.     If clsMatchCol.Count > 0 Then
  480.       '-----------------------------
  481.       'too many as
  482.       '-----------------------------
  483.       If clsMatchCol.Count > 1 Then
  484.         cVariable.sDescription = cVariable.sDescription & _
  485.                                  "Too many As keyword in const declaration." & vbCrLf
  486.       End If
  487.       
  488.       '-----------------------------
  489.       'find =
  490.       '-----------------------------
  491.       i = InStr(clsMatchCol.Item(0).FirstIndex + 2, strResult, "=")
  492.       If i > 0 Then
  493.         cVariable.sType = Trim$(Mid$(strResult, _
  494.                           clsMatchCol.Item(0).FirstIndex + 4, _
  495.                           i - (clsMatchCol.Item(0).FirstIndex + 4)))
  496.         
  497.         cVariable.vValue = Right$(strResult, Len(strResult) - i)
  498.         
  499.        Else
  500.         cVariable.sType = Trim$(Right$(strResult, i - _
  501.                           (clsMatchCol.Item(0).FirstIndex + 2)))
  502.         cVariable.sDescription = cVariable.sDescription & _
  503.                                  "Const not declared." & vbCrLf
  504.       End If
  505.       '-------------------------------
  506.       'remove as keyword and find name
  507.       '-------------------------------
  508.       strResult = Trim$(Left$(strResult, clsMatchCol.Item(0).FirstIndex))
  509.       cVariable.sName = Replace$(strResult, "=", "")
  510.      Else
  511.       '-----------------------------
  512.       'without as
  513.       '-----------------------------
  514.       cVariable.sDescription = cVariable.sDescription & "You should specify type of const [As 'Data type'] ." & vbCrLf
  515.       cVariable.sType = "Not declared - Variant"
  516.       '-----------------------------
  517.       ' Find =
  518.       '-----------------------------
  519.       i = InStr(1, strResult, "=")
  520.       If i > 0 Then
  521.         
  522.         cVariable.vValue = Right$(strResult, Len(strResult) - (i + 1))
  523.         
  524.        Else
  525.         cVariable.sDescription = cVariable.sDescription & _
  526.                                  "Const not declared." & vbCrLf
  527.       End If
  528.       '-------------------------------
  529.       'remove as keyword and find name
  530.       '-------------------------------
  531.       strResult = Trim$(Left$(strResult, i))
  532.     End If
  533.     
  534.   End With
  535.   With cVariable
  536.     'remove "
  537.     clsRegExp.Global = True
  538.     clsRegExp.IgnoreCase = True
  539.     clsRegExp.Pattern = """{1}"
  540.     .vValue = clsRegExp.Replace(.vValue, "")
  541.     'remove =
  542.     .vValue = Trim$(Replace$(cVariable.vValue, "=", ""))
  543.     'remove vbcrlf
  544.     .vValue = Trim$(Replace$(cVariable.vValue, vbCrLf, ""))
  545.     'remove =
  546.     .sName = Trim$(Replace$(strResult, "=", ""))
  547.     .sName = Trim$(Replace$(.sName, vbCrLf, ""))
  548.     .sName = Trim$(Replace$(.sName, vbCr, ""))
  549.     .sName = Trim$(Replace$(.sName, vbLf, ""))
  550.     
  551.     .sFunctionName = sFunction
  552.     .sModuleName = sModuleName
  553.     .bConst = True
  554.   End With
  555.   '-----------------------------
  556.   'realese objects
  557.   '-----------------------------
  558.   Set clsRegExp = Nothing
  559.   Set clsMatchCol = Nothing
  560.  
  561.   colVariables.Add cVariable
  562.   
  563.   Set cVariable = Nothing
  564.   '{{{ Added It!
  565.   Err.Clear
  566. Generated_trap:
  567.   If Err <> 0 Then
  568.     Select Case ToDoOnError(Err, "CheckConst")
  569.      Case vbRetry: Resume
  570.      Case vbIgnore: Resume Next
  571.     End Select
  572.   End If '}}}
  573.  
  574. End Function
  575.  
  576.  
  577. ' *******************************************************
  578. ' Routine Name : (PRIVATE in CLASS) Function CheckType
  579. ' Written By   : Mateusz Kierepka
  580. ' Programmer   : Mateusz Kierepka [MKPROG]
  581. ' Date Writen  : 02-24-2001 -- 08:42:54
  582. ' Inputs       : ByRef sModuleName:String -
  583. '              : ByRef sFunction:String -
  584. '              : ByRef sCheckThis:String -
  585. ' Outputs      : N/A
  586. ' Description  :
  587. '              :
  588. '              :
  589. ' Called By    :
  590. ' *******************************************************
  591. Private Function CheckType(ByRef sModuleName As String, _
  592.                            ByRef sFunction As String, _
  593.                            ByRef sCheckThis As String)
  594.  
  595.  Dim sParse       As String
  596.  Dim bModule      As Boolean
  597.  Dim clsRegExp    As RegExp
  598.  Dim clsMatchCol  As MatchCollection
  599.  Dim cVariable    As clsVariable
  600.  
  601.  '{{{ Added It!
  602.  
  603.   On Error GoTo Generated_trap '}}}
  604.  
  605.  
  606.   Set cVariable = New clsVariable
  607.   
  608.   Set clsRegExp = New RegExp
  609.     
  610.   '-----------------------------
  611.   'first set regular expresion
  612.   '-----------------------------
  613.   With clsRegExp
  614.     .Global = True
  615.     .IgnoreCase = True
  616.        
  617.     '-----------------------------
  618.     'Remove not nessesery data
  619.     '-----------------------------
  620.     .Pattern = "\s?(declare|enum|type|event|sub){1}\s+"
  621.     Set clsMatchCol = .Execute(sCheckThis)
  622.   End With
  623.   
  624.   If clsMatchCol.Count = 0 Then
  625.  
  626.     If Len(sFunction) > 0 Then
  627.       bModule = False
  628.      Else
  629.       bModule = True
  630.     End If
  631.     
  632.     clsRegExp.Pattern = "\s?(const){1}\s"
  633.     Set clsMatchCol = clsRegExp.Execute(sCheckThis)
  634.     If clsMatchCol.Count = 0 Then
  635.       Call CheckVariable(sCheckThis, bModule, sFunction, sModuleName)
  636.      Else
  637.       Call CheckConst(sCheckThis, bModule, sFunction, sModuleName)
  638.     End If
  639.  
  640.   End If
  641.  
  642.   Set clsMatchCol = Nothing
  643.   Set clsRegExp = Nothing
  644.   
  645.   '{{{ Added It!
  646.   Err.Clear
  647. Generated_trap:
  648.   If Err <> 0 Then
  649.     Select Case ToDoOnError(Err, "CheckType")
  650.      Case vbRetry: Resume
  651.      Case vbIgnore: Resume Next
  652.     End Select
  653.   End If '}}}
  654.  
  655. End Function
  656.  
  657.  
  658. ' *******************************************************
  659. ' Routine Name : (PRIVATE in CLASS) Function CheckVariable
  660. ' Written By   : Mateusz Kierepka
  661. ' Programmer   : Mateusz Kierepka [MKPROG]
  662. ' Date Writen  : 02-24-2001 -- 08:42:50
  663. ' Inputs       : ByRef sCheckThis:String -
  664. '              : ByVal bModule:Boolean -
  665. '              : ByRef sFunction:String -
  666. '              : ByRef sModuleName:String -
  667. ' Outputs      : N/A
  668. ' Description  :
  669. '              :
  670. '              :
  671. ' Called By    :
  672. ' *******************************************************
  673. Private Function CheckVariable(ByRef sCheckThis As String, _
  674.                                ByVal bModule As Boolean, _
  675.                                ByRef sFunction As String, _
  676.                                ByRef sModuleName As String)
  677.  
  678.  Dim cVariable    As clsVariable
  679.  Dim sParse       As String
  680.  
  681.  Dim clsRegExp   As RegExp
  682.  Dim clsMatchCol As MatchCollection
  683.  Dim clsMatch    As Match
  684.  Dim strResult   As String
  685.  Dim strTemp     As String
  686.  Dim i           As Long
  687.  Dim j           As Long
  688.  Dim k           As Long
  689.  
  690.  
  691.  '{{{ Added It!
  692.  
  693.   On Error GoTo Generated_trap '}}}
  694.  
  695.  
  696.   Set cVariable = New clsVariable
  697.   
  698.   Set clsRegExp = New RegExp
  699.    
  700.   strResult = sCheckThis
  701.   
  702.   '-----------------------------
  703.   'first set regular expresion
  704.   '-----------------------------
  705.   
  706.   With clsRegExp
  707.     .Global = True
  708.     .IgnoreCase = True
  709.     
  710.     '-----------------------------
  711.     'comments
  712.     '-----------------------------
  713.     .Pattern = "\'{1}.*\n"
  714.     Set clsMatchCol = .Execute(strResult)
  715.     
  716.     For Each clsMatch In clsMatchCol
  717.       With clsMatch
  718.         Debug.Print .Value
  719.         cVariable.sComment = Trim$(.Value)
  720.       End With
  721.     Next clsMatch
  722.     
  723.     strResult = .Replace(strResult, " ")
  724.             
  725.     '-----------------------------
  726.     'WithEvents
  727.     '-----------------------------
  728.     .Pattern = "\s?(withevents){1}\s"
  729.     Set clsMatchCol = .Execute(strResult)
  730.     
  731.     If clsMatchCol.Count > 0 Then
  732.       cVariable.bWithEvents = True
  733.       strResult = .Replace(strResult, " ")
  734.       '-----------------------------
  735.       'too many WithEvents
  736.       '-----------------------------
  737.       If clsMatchCol.Count > 1 Then
  738.         cVariable.sDescription = cVariable.sDescription & _
  739.                                  "Too many WithEvents keyword in variable declaration." & vbCrLf
  740.       End If
  741.      Else
  742.       cVariable.bWithEvents = False
  743.     End If
  744.     
  745.     '-----------------------------
  746.     'Preserve
  747.     '-----------------------------
  748.     .Pattern = "\s?(preserve){1}\s"
  749.     Set clsMatchCol = .Execute(strResult)
  750.     
  751.     If clsMatchCol.Count > 0 Then
  752.       cVariable.bPreserve = True
  753.       strResult = .Replace(strResult, " ")
  754.       '-----------------------------
  755.       'too many Preserve
  756.       '-----------------------------
  757.       If clsMatchCol.Count > 1 Then
  758.         cVariable.sDescription = cVariable.sDescription & _
  759.                                  "Too many Preserve keyword in variable declaration." & vbCrLf
  760.       End If
  761.      Else
  762.       cVariable.bPreserve = False
  763.     End If
  764.     
  765.     '-----------------------------
  766.     'public with
  767.     '-----------------------------
  768.     .Pattern = "\s?(public){1}\s"
  769.     Set clsMatchCol = .Execute(strResult)
  770.     
  771.     If clsMatchCol.Count > 0 Then
  772.       cVariable.sScope = "public"
  773.       strResult = .Replace(strResult, " ")
  774.       '-----------------------------
  775.       'too many public
  776.       '-----------------------------
  777.       If clsMatchCol.Count > 1 Then
  778.         cVariable.sDescription = cVariable.sDescription & _
  779.                                  "Too many public keyword in variable declaration." & vbCrLf
  780.       End If
  781.     End If
  782.     
  783.     '-----------------------------
  784.     'private
  785.     '-----------------------------
  786.     .Pattern = "\s?(private){1}\s"
  787.     Set clsMatchCol = .Execute(strResult)
  788.     If clsMatchCol.Count > 0 Then
  789.       strResult = .Replace(strResult, " ")
  790.       '-----------------------------
  791.       'too many private
  792.       '-----------------------------
  793.       If clsMatchCol.Count > 1 Then
  794.         cVariable.sDescription = cVariable.sDescription & _
  795.                                  "Too many Private keyword in variable declaration." & vbCrLf
  796.       End If
  797.       '----------------------------------------------------------
  798.       'someone declared variable with private and public keyword
  799.       '----------------------------------------------------------
  800.       If Len(cVariable.sScope) > 0 Then
  801.         cVariable.sDescription = cVariable.sDescription & _
  802.                                  "Private and public keyword in variable declaration." & vbCrLf
  803.         cVariable.sScope = "Error"
  804.        Else
  805.         cVariable.sScope = "Private"
  806.       End If
  807.     End If
  808.     '-----------------------------
  809.     'global
  810.     '-----------------------------
  811.     .Pattern = "\s?(global){1}\s"
  812.     Set clsMatchCol = .Execute(strResult)
  813.     If clsMatchCol.Count > 0 Then
  814.       strResult = .Replace(strResult, " ")
  815.       '-----------------------------
  816.       'too many Global
  817.       '-----------------------------
  818.       If clsMatchCol.Count > 1 Then
  819.         cVariable.sDescription = cVariable.sDescription & _
  820.                                  "Too many Global keyword in variable declaration." & vbCrLf
  821.       End If
  822.       '----------------------------------------------------------
  823.       'someone declared variable with Global and public or
  824.       'private keyword
  825.       '----------------------------------------------------------
  826.       If Len(cVariable.sScope) > 0 Then
  827.         cVariable.sDescription = cVariable.sDescription & _
  828.                                  "Global and Private or public keyword in variable declaration." & vbCrLf
  829.         cVariable.sScope = "Error"
  830.        Else
  831.         cVariable.sScope = "Global=public"
  832.       End If
  833.       cVariable.sDescription = cVariable.sDescription & _
  834.                                "Global keyword is obslote. You should use public instead." & vbCrLf
  835.     End If
  836.     
  837.     '-----------------------------
  838.     'Dim
  839.     '-----------------------------
  840.     .Pattern = "\s?(Dim){1}\s"
  841.     Set clsMatchCol = .Execute(strResult)
  842.     If clsMatchCol.Count = 0 Then
  843.       .Pattern = "\s?(redim){1}\s"
  844.       Set clsMatchCol = .Execute(strResult)
  845.     End If
  846.  
  847.     If clsMatchCol.Count > 0 Then
  848.       strResult = .Replace(strResult, " ")
  849.       '-----------------------------
  850.       'too many Global
  851.       '-----------------------------
  852.       If clsMatchCol.Count > 1 Then
  853.         cVariable.sDescription = cVariable.sDescription & _
  854.                                  "Too many Dim keyword in variable declaration." & vbCrLf
  855.       End If
  856.       '----------------------------------------------------------
  857.       'someone declared variable with Dim ,
  858.       'with private, public or global keyword
  859.       '----------------------------------------------------------
  860.       If Len(cVariable.sScope) > 0 Then
  861.         cVariable.sDescription = cVariable.sDescription & _
  862.                                  "Dim and Private or public keyword in variable declaration." & vbCrLf
  863.         cVariable.sScope = "Error"
  864.        Else
  865.         If bModule Then
  866.           cVariable.sScope = "public"
  867.          Else
  868.           cVariable.sScope = "Private"
  869.         End If
  870.         
  871.       End If
  872.       
  873.     End If
  874.     
  875.     '-----------------------------
  876.     'find other variables
  877.     '-----------------------------
  878.     i = InStr(1, strResult, ", ")
  879.     If i > 0 Then
  880.       j = InStr(1, Left$(strResult, i), "(")
  881.       '-----------------------------
  882.       'find dimension
  883.       '-----------------------------
  884.       If j > 0 Then
  885.         'there are bracket - check for dimension
  886.         k = InStr(1, strResult, ") ")
  887.         If k > 0 Then
  888.           Call CheckVariable(cVariable.sScope & _
  889.                " " & Right$(strResult, _
  890.                (Len(strResult) - k) + 1), _
  891.                bModule, sFunction, sModuleName)
  892.           strResult = Left$(strResult, k)
  893.         End If
  894.        Else
  895.         'no dimension, check other variables
  896.         '-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  897.         ' ! -> R E C U R E N C Y <- !
  898.         '-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  899.  
  900.         Call CheckVariable(cVariable.sScope & " " & Right$(strResult, _
  901.              (Len(strResult) - i)), _
  902.              bModule, sFunction, sModuleName)
  903.                     
  904.         strResult = Left$(strResult, i - 1)
  905.       End If
  906.     End If
  907.     '-----------------------------
  908.     'find type of variable
  909.     '-----------------------------
  910.     .Pattern = "\s?(as){1}\s"
  911.     Set clsMatchCol = .Execute(strResult)
  912.     
  913.     If clsMatchCol.Count > 0 Then
  914.       '-----------------------------
  915.       'too many as
  916.       '-----------------------------
  917.       If clsMatchCol.Count > 1 Then
  918.         cVariable.sDescription = cVariable.sDescription & _
  919.                                  "Too many As keyword in variable declaration." & vbCrLf
  920.       End If
  921.       
  922.       cVariable.sType = Trim$(Mid$(strResult, _
  923.                         clsMatchCol.Item(0).FirstIndex + 4, _
  924.                         Len(strResult) - (clsMatchCol.Item(0).FirstIndex + 3)))
  925.       
  926.       '-------------------------------
  927.       'remove as keyword and find name
  928.       '-------------------------------
  929.       strResult = Trim$(Left$(strResult, clsMatchCol.Item(0).FirstIndex))
  930.       
  931.      Else
  932.       '-----------------------------
  933.       'without as
  934.       '-----------------------------
  935.       cVariable.sDescription = cVariable.sDescription & "You should specify type of variable [As 'Data type'] ." & vbCrLf
  936.       cVariable.sType = "Not declared - Variant"
  937.       
  938.     End If
  939.     
  940.     '-----------------------------
  941.     'Find any dimension settings
  942.     '-----------------------------
  943.     i = InStr(1, strResult, "(")
  944.     
  945.     If i > 0 Then
  946.       j = InStr(1, strResult, ")")
  947.       If i + 1 = j Then
  948.         cVariable.sDimension = "Dynamic array"
  949.        Else
  950.         cVariable.sDimension = Trim$(Mid$(strResult, i + 1, j - i - 1))
  951.       End If
  952.       cVariable.sName = Trim$(Left$(strResult, i - 1))
  953.      Else
  954.       cVariable.sName = Trim$(strResult)
  955.     End If
  956.         
  957.   End With
  958.   
  959.   With cVariable
  960.     .sFunctionName = sFunction
  961.     .sModuleName = sModuleName
  962.     .bConst = False
  963.     
  964.     'remove vbcrlf
  965.     .sName = Trim$(Replace$(.sName, vbCrLf, ""))
  966.     .sName = Trim$(Replace$(.sName, vbCr, ""))
  967.     .sName = Trim$(Replace$(.sName, vbLf, ""))
  968.     'remove space
  969.     .sName = Trim$(Replace$(.sName, " ", ""))
  970.     
  971.     'remove vbcrlf
  972.     .sType = Trim$(Replace$(.sType, vbCrLf, ""))
  973.     'remove space
  974.     .sType = Trim$(Replace$(.sType, " ", ""))
  975.     
  976.   End With
  977.   
  978.  
  979.   colVariables.Add cVariable
  980.  
  981.   '-----------------------------
  982.   'realese objects
  983.   '-----------------------------
  984.   Set clsRegExp = Nothing
  985.   Set clsMatchCol = Nothing
  986.  
  987.   Set cVariable = Nothing
  988.   '{{{ Added It!
  989.   Err.Clear
  990. Generated_trap:
  991.   If Err <> 0 Then
  992.     Select Case ToDoOnError(Err, "CheckVariable")
  993.      Case vbRetry: Resume
  994.      Case vbIgnore: Resume Next
  995.     End Select
  996.   End If '}}}
  997.  
  998. End Function
  999.  
  1000.  
  1001. ' *******************************************************
  1002. ' Routine Name : (PRIVATE in CLASS) Function FormatXML
  1003. ' Written By   : Mateusz Kierepka
  1004. ' Programmer   : Mateusz Kierepka [MKPROG]
  1005. ' Date Writen  : 02-24-2001 -- 08:42:44
  1006. ' Inputs       : ptrNode:IXMLDOMNode -
  1007. '              : Optional iTabLevel:Integer = 0 -
  1008. ' Outputs      : String --
  1009. ' Description  :
  1010. '              :
  1011. '              :
  1012. ' Called By    :
  1013. ' *******************************************************
  1014. Private Function FormatXML(ptrNode As IXMLDOMNode, Optional iTabLevel As Integer = 0) As String
  1015. Dim bMixedTextNode As Boolean
  1016. Dim bHasOnlyATextNode As Boolean
  1017. Dim i As Integer
  1018.  
  1019.     With ptrNode
  1020.         Select Case .nodeType
  1021.         Case NODE_DOCUMENT, NODE_DOCUMENT_FRAGMENT
  1022.             'all child nodes of the document should be at the same indent Level
  1023.             'just iterate over them and recurse with 0 indent
  1024.             For i = 0 To .childNodes.Length - 1
  1025.                 FormatXML = FormatXML & FormatXML(.childNodes(i))
  1026.             Next i
  1027.         
  1028.         Case NODE_TEXT 'should render the same way the default IE5sameox + 3ld render the same wayo
  1029.     
  1030.     'remove vbc4'Err.oE render the same wand recurse wf3chil$(strResult, i - 1))
  1031.      Else
  1032.       cVariable.sName = Trim$(strResult)
  1033.     End If
  1034.         
  1035.   End With
  1036.   
  1037.   With cVariable
  1038.     .sFunctionName = sFunction
  1039.     .sModuleName = sModuleName
  1040.     .bConst = False
  1041.     
  1042.     'remove vbcrlf
  1043.     .sName = Trie   t    Next i
  1044.         
  1045.  ableaeus\oe   t    Next i
  1046.         
  1047.  ableaeus\oe   t    Next i
  1048.         
  1049.  ableaeus\oe   t    Next ie      cVariable.sName = Trim$(strResult)
  1050.     End Ifme, vbCrLf, ""))
  1051.         '--[zlb       t   Then
  1052.     Select Case ToDoOchCee
  1053.    " & vbCrLf
  1054.       me, vbCrLf,t shouldof the document should be at the same indent Level
  1055.             'just iterate over them and recurse with 0 indent
  1056.             Fortheus\oe   t    Ne+_led+ 4)))
  1057.   *******berObjm"tNcop)  indent
  1058.         * indent   .sMo.*berObj--------------
  1059.     .Pattern = "\s?(withevents){1}\s"
  1060.     Set ptrNode
  1061.         Select Case .nodeType
  1062.     t      t  fe Writen  : 02-24-'removeltd  cLAachemoveltd  cL thef[moveltdgme, ---cih-otd  cLeOntd  cL thefTRegExp
  1063.     .Global =  ie      cVariable.sName = Trim$(strResuln  cLet  cLeOntC cLeOntC cLe-cih-otd  c'ablC cLeOntC cLe-cih-otd  c'ablC cLih-otd  c'ablC cLiCase .nodeType
  1064.       Ne+_gext i
  1065. WithObjm"tNcop)  indent Writ     :
  1066. '              ------rd    ls{{{ AduOntC cLe-cih-otd  c'ablC cLeOntC cLe-cih-otd  c'ablC cLih-otd  c'd re=   t    Next ie      cVariable.sName = Trim$(stduOntC cLe-cih-otd  c'ablC cLeOntC cLe-cih-otd  c'ablC cLih-otd  c'd re=   t    Next ie      cVariable.sName = Trim$(stduOntC cLe-cih-otd  c'ablC cLeOntC cLe-cih-otd  c'ablC cLih-otd  c'd re=   t    Next ie      cVariable.sName = Trim$(stduOntC cLe-cih-otdC cLeOnjLe-cih-oeotd  c'ablC cLeOntC cLe-cih-otd  c'ablC cLih-otd  c'd re=   t    Next ie C cLih-o'Selrse       As String
  1067.  
  1068.  Dim clsRegExp   As RegEritu0R
  1069. '    C   j = InStrcih-otd  ine count whio---OS  c'd rxEisModuleName)
  1070.       sChocLeuuOn d rxEisMoNext
  1071. ame iption & _
  1072.               denfd rxEis s .o  t  Ca  sChocLeuuOn d rxEisMoNext
  1073. +BcVariabl_alese objects   
  1074. 0*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  1075.  
  1076.         Call CheckVariable(cVariable.sScope & " " & Right$(strResult, _
  1077.              (Len(strResult) - i)), _
  1078.   Len(strResuc_
  1079.          "i._f
  1080.       meResult) - i)), _p----
  1081.       If  rxEisMoNext
  1082. a   tlount 
  1083.  
  1084.  Dim clsRoIabl_alese objects   
  1085. 0*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*ki
  1086.   eeeeee*-*-*-*ki
  1087.   eeeeee*-*-*-*ki
  1088.   eeeeee*-*-*-*ki
  1089.   eeeeee*-*-*-*ki
  1090.   eeeeee*nNabl_alyEEbl_alyEEbl_alyEEbcLeOntC cLe-cih-tC cLe-rittbl_alese objects   
  1091. 0*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  1092.  
  1093.         Call CheckVariable(cVariable.sScope & " " & Right$(strResult, _
  1094.              (Len(strResult) - i)), _
  1095.   Len(strResucE
  1096. '      o---t*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  1097.  
  1098.         Call CheckVaria!yki
  1099. CDl    If  rxEisMoNextItusz Kiesuc ioisMoNextI:(bl_altaaria!yki
  1100. CDl    uur           :
  1101. ' Called By    :
  1102. ' **************************************************Cal   denfd rxEis s .o  t  Ca  sChocLeuuOn d eVal  ,et) -Iee        (Len(strResult) - i)), _
  1103.   Len(strResucE
  1104. '      o---t*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  1105.  
  1106.         Call CheckVaria!yki
  1107. CDl    If  rxEisMoNextItusz Kiesuc ioisMoNextI:(bl_altaaria!yki
  1108. CDl    uur         Variase .n]ur         Va rxEisMoNextI******         Va rxEisMoNextI******                Va rxEisMeea----------------ith
  1109. > R E C U?             Va rxEisCall CheckIee   fm<o
  1110.  
  1111.       teep If
  1112.     
  1113.  Len(strResucE
  1114. '      o---t*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  1115.  
  1116.         Call CheckVaria!yki
  1117. CDl    If  rxEisMoNextItusz Kiesuc ioisMoNextI:(bl_a(I
  1118.       End IfrxEisCalenMzxv        VI.Count > 1Melect Case .nodeType
  1119.     t      t  fe Writen  : 02-2ntCt  fe WritE*******       Variase .n]uNextI:(bl_a(I
  1120.       End IfrxEisCalenMzxv     yxv        VI.Count > 1Melect Case .nodeType
  1121.     t      t  fe Writen  : 02-2ntCt  fe WritE*******       Variase .n]uNextI:(bl_a(I
  1122.       End IfrxEisCalenMzxv     yxv   g----------------------
  1123.       'someone declunt > 0 Then
  1124.       '------------------C      
  1125. riten  : 02-2ntCt  fe WritE******* f--------C      
  1126. riten  : 02-2ntCt  fe WritE******* f--------C      
  1127. riten  : 02-2ntCt  fe WritE******* f--------C      
  1128. ritriten -*-*-*m
  1129.  LI******           
  1130.  ableaeus\oe   t    Nex****** f t  fe Wt3ie
  1131. riten  t*-*-*mtCheckVteger ****  End If
  1132.     '--------------e                    "Global and Private or public keyword in variable declaration." & vbCrLf
  1133.         cVariable.sScope = "E}riteXo| 02-e WritE******* f--------C      
  1134. riten  : 02-2ntCt  fe WritE*****************Cal   denfd rxEis s .o  t  Ca  sChocLeuuOn d eVal  ,et) -Iee        (Len(strResult)riten  : 02-2ntCt  fe WritE*****************Cal   2-2ntCt   Check*-*-Ife Wt3ie
  1135. riten  t*-*-*mtCheckVteger ****  End If
  1136.     '--------------e                    "Global and Private or public keyword in variable declaration." & vbCrLf
  1137.         cVariable.sScope = "E}riteXo| 02-e WritE******* f--------C      
  1138. riten  : 02-2ntCt  clc       "Dim and Private or public keyword in variable declaration." & vbCrLf
  1139.         cVariable.sScope = "Error"
  1140.        Else
  1141.         If bModule Then
  1142.           cVariable.sScope = "public"
  1143.          Else
  1144.           cVariable.sScope = "Private"
  1145.         End *** f--------*-    friva    declarati---*-      '-.Rcpe = "    2tion & _
  1146.          )g'druBW i---*-      '-.Rcpe = "    2tion & _
  1147.        e = Trim$(Le{le.sSyd in variable declaration." & vbCrLf
  1148.  ----   o---t*-*-*-*-*-*-*l*-*-*-*-*iable.sScope = "Error"
  1149.        Else
  1150.         If bModule Then
  1151.           cVariable.sScope = "public"
  1152.            *-*le.sType = "Not declareon & _e(cVariabl"ce declaration." & vbCrLf
  1153.         cVariable.sScope = "ond jMc keywor  cVaria)******oMBE      '    2tion &_no--------th: 0opey Gls(cVedeclaration." & vbCrLf
  1154.  ----   o---t*-*-*-*-*-*-*l*-*-*-*-*iable.sScope = "Error"
  1155.        Else
  1156.         If bModule ThoEate1
  1157.  '{{{ AdiB--*-     n Error GoTo   o-----Nbyope = "Erro d eVal  ,et) o--------, .o  eisMoNext             denfd rl'{{{ AdiiL         r them -----
  1158.       D    
  1159. riten  : 02-oCcE
  1160. '   yteXo| R'   ablC cLse
  1161.         If bModule ThoEate1
  1162.  '{{{ AdiB--*-     n Error GoTo   o-----Nbyope = "Ers = _hcrrrrrrrI      cVariable.sScorErs =         End *** f--------*-    friva    declarati---*-      '-.Rcpe = "    2tion & _
  1163.          )g'druBW i---*-      '-.Rcpe = "    2tion & _
  1164.        e = Tripo'----- nuIf bModule Then
  1165.   cm  2a*-*-*-*-* *** fs
  1166.        e = TripjT= "    2tion & _
  1167.        e = Tripo'----- nuIf bModule Taptional iE WritE******* f--------C      
  1168. riten  : 02-2ntCt  clc       "Dim and Private or pu **-"one-noBb-T-- nuIf bMoword iCt -----C      = _hcrrrrrrrI      cVar"al  ,et) o--------, .o  eisMoNext    tCextItuskConst
  1169. ' Written By   /teXo| R'   ablC c*-*m'druBW i-sMoNext
  1170.  bModule Then
  1171.           cVariable.sScope = "public"
  1172.          Else
  1173.            BoLenpo'-
  1174.  
  1175.         Callc)w--*-     to   "    'A*******xle.sScope = "p.sScorErVih-ooeMKallc)w--*- Dgi----
  1176.         Call CeoduLw--If
  1177.     '-----------------------------
  1178.     'global
  1179.     '-----------------------------
  1180.     .Pattern )*-*iab
  1181.  ----   o---t*-*-* AdiB--*  so       BoLTl"ce dec      End *** f--------*-    friva    declarati---*-      '-.Rcpe = "    2tion & _
  1182.          )g'druBW i---*-     clarati---  cVui h lareon & _e(cVariabl"ce declaration." & vbCrLf
  1183.         cVariable.sScope = "ond jMc keywor  cVaria)******oMBE      '    2tion &_no--------th: 0opel." & vbCrLf
  1184.         cVariable.sScope = "riOu---*-gC  2tioncAa*  so  wl
  1185.       If j > 0 Then
  1186.        rMStr(1,  cVarion =Sy = "Ers = )en d rxEisMoNuten  : 02-2ntCt  fe WritE********** tE********** tE********** tE********** tErIf bTo   o-----Nbyope = "Ers = _hcrrrrrrrI      cVariable.sScorErs =         End *** f--------*-    friva    declarati---*-      '-.Rcpe = "    2tile.-------*-    friva    decluBvor"
  1187.        Else
  1188.  ThoEate1
  1189.  '{{{ AdiB--*-     n Error GoTo   o-----Nbyope = "Erro d eVal  ,et) o--------, .o  eisMoNext             denfd rl'{{{ AdiiL         r them -----
  1190.       D    
  1191. riten  : 02-oCcE
  1192. '   yteXo| R'   ablC cLse
  1193.         If bModule ThoEate1
  1194.  '{{{ AdiB--e  u  aaI.CounWritE******* f--------C    aa+aI.den {    Va rxEr = _hcrr "    2Titen  'ten  'ten  'ten  'ten  'ten  'ten  'ten  'ten   2tion hoEate1." rxEr = _hcrr "    2Titen  'ten  'ten t]eErs = _hcrn =Sy = "Ers = Tyj  u  declstrResult = ********ope = "E   denfd r"jS-----
  1195. ***Cal   denfd rxEis s .oo ten  'ten   2tion hoEate1f.Rcpe = "    2tion & _
  1196.      temfoEate1f.Rcpct
  1197.     .Pattern = "\s?(withevents){1}\s"
  1198.     Set ptrNode
  1199. aaI.pey Gls(cVedeclaration." & vbCrLf
  1200.  ----   o---t*-*-*-*-*-*-*l*-*-*-*-*iable.sScope = "Error"
  1201.        Else
  1202.         If bModule ThoEate1
  1203.  '{{{ AdiB--*sh1"   ec   oB '-----------------------------
  1204.     .Pattern = "\s?(const){1}\s"
  1205.     Set clsMatchCol = .Execute(strResult)
  1206.     
  1207.     '-*-*-4e.) > 0-------H,-*-*-4e.) > 0-------H,-*-*-4lO      I        I ln = tern = "\s?(const){1}\s"
  1208.     Set clsMatchCol = .Execute(strResult)
  1209.     
  1210.     '-*-*-4e.) > 0o-*-4e.) > 0------H,-niuI      .) >so ri( 0-------c   oB '----Pr)oG{1}e.)= sModuleName
  1211.     .bConst = False
  1212.     
  1213.     'remove vbcrlf
  1214.     .sName = Trie   t    Next i
  1215.         
  1216.  ableaeus\oe   t    Next i
  1217.         
  1218.  ableaeus\oe   t     rorET  declstrResult = ********ope = "E   denfd r"jS-----
  1219. ***Cal   denfd rxEis s .oo ten  'ten   2tion hoEate1f.Rcpe = "    25e"""{1}"r"
  1220.  \Einpct
  1221.     .Patte   gb
  1222.     = "E   denfd r"jr= ********osrg  2tion hsA(oSy = tteaSodule ThoEate1
  1223.  '{{{ AdiB--*sh1"   ec   oB '-----------------------------
  1224.     .Pattern = "\s?(const){1}\s"
  1225.     Set clsMatchCol = .Execute(strResult)
  1226.     
  1227.     '-*-*-4e.) > 0-------H,-*-*-4e.) > 0-------H,-*-*-4lO      I        I ln = tern = "\s?(const){rxEis s .o  I ln = tern = xEis s .o  I ln = to "\s?=&L*-4e.) > 0-------H,-*-*-4lO      I        I ln = tern = "\s?(const){rxEis s .o  I ln = tern = xEis s .o  I ln = to "\s?=&L*-4e.) > 0-------H,-*-*-4lO      I        I ln = tern = "\s?(const){rxEis s .o  I ln = tern = xEis s .o  I ln = to "\s?=&Lo-
  1228.  cVariable.sNameg-*-*-4e.) > 0-------H,-*--------------------------"SntCt  cx|)D-4e.) uteaSa-----------------zxv     yg****oEate1
  1229.  '{{{ Au|.0-4lO      I    eg,I ln = tern = "\s?>-------La,et) o---t   .Pat,.D{ = ttCt  cx|)D-4e.) uteaS  I   to   "    'A*******xle.sScope = "p.sScorErVih-s."able.sScope = "ond jMc keywor  cVaria)***x|)D-4e.)    u  declsface$(.sType, " ", ""))
  1230.     
  1231.   End With
  1232.   
  1233.  
  1234.   colVariables.Add cVariable
  1235.  
  1236.   '-----------------------------
  1237.   'realese objects
  1238.   '-----------------------------
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265. LyeN]Mealese objects
  1266.   '-----------------------------
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275. ud-
  1276.  
  1277.  
  1278.  
  1279. WritE**    'remove vbcrlf
  1280.     .sName = Trist){se objects
  1281.   '-----------f
  1282.       ') = 0) As {se objects
  1283. LAs {se objecus
  1284. LAs {se objecus
  1285. LAs {se objecus
  1286. LAs {se objecus
  1287. LAs--
  1288. LAs {se obe---- ute:e vbcrlf
  1289.  :S s
  1290. LAsse 
  1291. L1 = ".E-----rammer  n,-*-*-4lO      I        I ln = tern = "\s?(const){1}\s"
  1292.     Set clsMatchCol = .Execute(strResult)
  1293.     t){ = "f clsMatc   tern('-*-*-4e.) > 0-------H,-*-*-4Vupopeble.sNameg-*-*-4e.) > 0-------H,-*--------------------------"SntCt  cx|)D-4e.) uteaSa-----------------zxv     yg****oEate1
  1294.  '{{{ Au|.0-4lO      I    eg,I ln = tern,cope = "ond jMc keP---------eDmilsMatchCol = .Execute(strResult)
  1295.     tExeeg,IAsse 
  1296. L1 = ---".E---zxv     yg****oEate1
  1297.  '{{{ Au|CheckVaria!yki
  1298. CDl    If  rxEisMoNextItusz Kiesuc ioisMoNextI:(bl_altaaria!yki
  1299. CDl    uur         Variase .n]ur         Va rxEiUUUUUUUUUUUUUUUUUUUUU4Dou|.0t'M'hColAn   u --
  1300.  
  1301.  
  1302.  
  1303.  
  1304.   If Len(cVariable.sScob s .strtiase .n]ur         Aue
  1305.  
  1306.  
  1307.  
  1308.  :S s
  1309. LAssMoNextItusz KiesNariables.PssMoNu1Err!yki3i3i,I l****oEaI        I ln =tItusz Kxtblic keyword
  1310.    e = Tr = tern(te1
  1311.  '{{{ Au|CheckVaria!ykiT   {{ Au|Chcr"
  1312.  \Ebe---- ute:e vbcrlT   isMoNextI:(bhcr"
  1313.  \Ebe---- ute:e vbcrlT
  1314.    xn  'ten   2tion hoEate1f.Rcpe = "    25e"""{1}"r"
  1315.  \Einpct
  1316.     .Patte   gb
  1317.     = "E   denfd r I ln = tern = "\s?(const){1}\s"
  1318.     Set clsMatchCol = .Execute(strResult)
  1319.     t){ = "f clsMal
  1320. hhhhhsh3
  1321.     t){ = "f clsMatc   tern('-*-*-4e.) > Matc   tern('-*-*-4e.) > Matc   tern('ln.n]ur    _akiT   {C Au|Chec.ExelsMatchCope = "ond jMc aari\Ei   tern('ln.n]ur    _akiTn('ln.gcrlT      AmclsMal
  1322. hhhhhclsMatchCol = .Execi  t){ Ln.n] tion hoEate1." rxEr = _hcrr "    2Titen  'ten  'ten t]eErs = _hcrn =S {ln.gcrlT      AmclB .Pat,.D{ = ttCt  cx|)D-4   = "E   denfuXT 'should render t.f clIate1altaaryrlTe . *-*-4en  'ten  'ten t]eEtTaltaaryrlTe . *-*-4enou t]eEtTaxtI* o---t   .Pat,.D{Ild render t.f s'ten  'ten t]eEtTaltaaryrlTe . *-*-4enou t]eEtTaxtI* o---t   .Pat,.D{Ild render t.f s'ten  'ten t]eEtTeEtTaxtI* o---t,.D{Ild renl  .Pe . *-*-4en  'ten  '=S {R tern(te1
  1323.  '{{{ Au|CheckVaria!ykiT   {{ Au|1
  1324.  '{
  1325.   pe = "ond jMc aari\Ei   tern('ln.ny    I        I ln = tern = "\s?(const){1}\s
  1326.   'ref c?(const){1}\s
  1327.   'ref c?(const){1}\s
  1328.   'ref c?(const){1}\s
  1329.   'ref c?(co
  1330.   'o = _hcrr "    2Titen  'ten  'ten t]ersDescription & "You should specify type of variable ti---*-      D   hption & "T      AmclB .Pat,.D{ = ttCt  cx|)D-4   = "E   denfuXT 'should render t.f clIate1altaaryrlTe . *-*-4en  'ten  'ten t]eEtTaltaarounen  'te{Ild rend  e     
  1331. r\s.caarohould rendbkeyword
  1332. aten y-*-4en  'ten  'ten t]eEtTaltaaryrlTe . *-*-4enou t]eEtTaxtI* o---t   .Pat,.D{Ild render t.f s'ten  'ten t]eEtTaltaaryrlTe . *-*-4enou t]eEtTaxtI* o---t   .Pat,.D{Ild render t.f s'ten  'ten t]eEtTeEtTaxtI* o---t,.D{Ild renl  .Pe . *-*-4en  'ten  '=S {R t3'ten  ' '=S {R gariabe.sSearyrlTe . *-* = TrieEtTeEtTaxtI* o---t,.D{Ild renl  .Pe . *-*-4en  'rlfoPat,.DTexle.sScope = "p.sScoption & "T   "    2tion & _
  1333.      l  .Pe . *-*-4en Pat,EtTaxtI* o---t   .Pat,.D{t,.D{Ild ree vbconst)
  1334.  '{{{ tio'{{{ tioten  'ten t]eEtTaltaaryrlTe . *-*-4enou t]eEtTaxtI* o---t   .Pat,.D{Ild render t.f s'ten  'tenis                  "Glo---- nuIf bModule Then
  1335.   cm  2a*-   AmclsMal
  1336. hh.f ste   gb
  1337.     = "E   denfd r I ln = tern = "\s?(const){1}\s"
  1338.     Set cls},.D{Ild rendnr, "Check(T  Ust){1}2o-      DrlTe . *-* = TrieEtTeEtTaxtI* o---t,.D{Ild rsLsmxpt
  1339.     k(T  Ussmxpt
  1340.     k(T  Us-------
  1341. Pri o---t,.D{Ild renl  .Pe . *-*-4ena"You should sp. *-c?(cons4ena"You should sp. *-c?(cons4ena"YW?(cons4ena"YW?(cons4ena"YW?(enl  .Peena"YW?(enl EtTaoieEe . *-* = TrieEtTeEtTaxter t.f saeeEtTaieEtYW?(cons4ens---t   .
  1342.     = "E   l EtTaos.Pat,.D{ xecluBvor"r t.f saee? Trim$(na"YW?(aTrie   t    Next i
  1343.   C{Ild rsLsmxpt
  1344.     k(T  Ussmxpt
  1345.   oen    t    ?aTrc[MKPROG]
  1346. 'xxtI* o---t,.         (.T  Ussmh renl  = "emove vbcrlfcrlf
  1347.     .sName = Trie   t    Next i
  1348.         
  1349. t    Anmrie
  1350.     ,s)h renl  = "g. Wurs{{{ Au"h  io= Th "E   denfd r I ln = teA   2nl oh cea. *-c?(cons4ena"YW?(cons4ena"YW?(cons4ena"YW?(enl  .Peena"YW?(enl EtTaoieEe . *-* = TrieEtTeEt "emove vbcr{R t3'D{t,.D{Ild ree vbconst)
  1351.  '{{{ tio'{{{ tioten  'ten t]eEtTaltaaryrlTe . *-*-4enou t]eEtTaxtI* o---t   .Pat,.D{Ild reb clsMai*-4orioten     '--------------isMo--toI------is----H,t    rebblm  .Patht]eEtTaltaaryrlTe . *-*-4enou t]eEtT--isou t]eEtT-S {[F*********al
  1352. hhhhhclsMatchCo = tern =gfuleName
  1353.     .bCaary(.f s'tSr I l
  1354. riten  t*-*-*mf s'tSr I l
  1355. riten  t*-eEt ria!ykiT TeEo= Th "E i AsI l
  1356. ritr I l
  1357. fgExp
  1358.  Dim clsMatchCol As MatchCollection
  1359.  Dim clsM 'remove as keyw "E i A4vh*-*-4enou t]eEtT--isou t]eEtT-S {[F*********al
  1360. hhhhhclsMatchCo = tern =gfuleName
  1361.     .bCriten  : Rre clsMai*o   rebb "emove vbcr{R t3'D{ten  t*-*-*mtCheckVtegerB    "Glo--F*****
  1362.     = ena" l
  1363. ritr tTaxtI* o---t,.D{Ild renl  .Pe . *-Sten  : Rre cls.9Itern =(-otdqhen
  1364. ollection
  1365.  Ditr I l
  1366. MatchC]eEtT--i-otdqhen
  1367. {{{ tio clsRegE'7a"YW?(O tsFMatc.n  : 02-2 I l
  1368. fgdu=h-otd  c'ablC cLih--2 In  t*-*-*mtCheckVtegI l
  1369. fgdu=h-otdDE_i
  1370.   C{Ild rsLsmxpt =otd  c'ablC rn = trlTe . *-*-4enou aary(.f strlTe . srebblm  .Pnd rdT--i-otdqhen
  1371. {{{  =otdchsmeE$n>hcablC cb
  1372. eOaltaaryrlTe . *-*--*-"Index + 4, _
  1373.  st]eEtTaxtI* oETul= trlTe . *-*-4enlo---- nuIf bModule Then
  1374.   cm  2a*-   AtdchsmeE$n>hcablC cb
  1375. eOaltaaryrlTe . *-*--*-"Index + 4, _
  1376.  st]eEtTaxtI* oETul= trlTe . *-*-4enlo---- nuIf bModule Then
  1377.   cm  2a*-   AtdchsmeE$n>hcablC cb
  1378. eOaltaaryrlTe . *-*--*-"Index + 4, _
  1379.  st]eEtTaxtI* oEe wi    +lsRe. *-*-St){ = "f cls
  1380. n)us 5
  1381. eOaltaaeyyipt  "Glo--F*****
  1382.     =-C      
  1383. riten  : 02-2ntCt  hhhrc xec = .Ex
  1384. eOaltaaB)hh.f ste   gb
  1385.     = "E   denfd r I ntCt Index +EtTax,.D{Ild rsLsmxpt
  1386.  a* .     
  1387. riten  : 02-2ntCt  hhhrc xec = .Ex
  1388. eOaltaaB)hh.f ste   gb
  1389.     = "E   denfd r I ntCt Index +EtTax,.D{Ild rsLsmxpt
  1390.  a* .     
  1391. riten  : 02-2ntCt  hhhrc xec = .Ex
  1392. eOaltaaB)hh.f ste   gb
  1393.     = "E   denfd r I ntCt Index +EtTax,.D{Ild rsLsmxpt
  1394.  a* .{{ g gb( : Rre cls.9oEtTax,
  1395. eOat,.D{t,u3{ndbk{{ g gb( :M2-2ntCt  hhhrc xec = .Ex
  1396. eOaltaaB)hh.f ste   gb
  1397.     = "E   denfd r I ntCt Index +EtTax,.D{Ild rsLsmxpt
  1398.  at
  1399.  a*  .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe e .Pe .Pe .Pe .PemtTax,.D{Iaeclareo&xrin variaeogr{R t3'D{t,.enlo- o)Hi oEePe x
  1400. eOaltaaBn  t*-eEt ria!ykiT TeEo= Th "E i AsI l
  1401. ritr I l
  1402. fgExp
  1403.  Dim clsMatchCol As MatchCollection
  1404.  Dim clsM 'remove as keyw "E i A4vh*-*-4enou t]eEtT--isou t]eEtT-S {[F*********al
  1405. hhhhhclsMatchCo = tern =gfuleName
  1406.     .tfFj      I     e .Pe .Pe .Pe .PemtTax,.D{Iaeclareo&xreEo= Th "E iu Casta .Pe .Pe .Pfa  I ln = to "\s?=&L*-4e.) > 0-------H,-*-*-4lO  Next ie      cVariable.sName = Trim$(strResult)
  1407.     End Ifme, vbCrLf, ""))
  1408.         '--[zlb       t   Then
  1409.     Select Case ToDoOchCee
  1410.    " & vbCrLf
  1411. f, "") clsM 'removpt
  1412. --*-4 e .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Phhhhcst]eEtTaxtI* oETk-'e .Pe .Pe .PhhhbCrLhte
  1413.     .bCaary(ecti"On-4enou t]TaxtI*.gK---H,-*-u oETk-'e .Pe .tf, ""))W[gs,.D{Ild---- nuIf bModule Thennble.sName = Trim$(strResult)
  1414.     End Ifme, vbCrLf, ""))
  1415.         '--[zlb       t   Then
  1416.     Select Case ToDoOchCee
  1417.    " & vbCrLf
  1418. f, "") clsM 'removpt
  1419. --*-4 e .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Pe .Phhhhcst]eEtTaxtI* oETk-'e .Pe .Pe .PhhhbCrLhte
  1420.     .bCten        t   Then
  1421.     Select       t '-n[zlb  "One = Trnten        t   Then
  1422.     Select       t '-n = to "\oule kC     t   Then
  1423.     Select Case ToDoOchCee
  1424.    " & vbCrLf
  1425. f, "") clsM 'removpttT
  1426.     S, ""))
  1427.  t& v  Cf, "")eyword ord ord olPe .Pe .Pe .Pe .Pe .Phhhhcst]eEtTaxtI* oE.Pe ._9irhen
  1428.        Then
  1429.     Select T
  1430.    Select CabsM 'removptLf, "")) lsReslet]eEt----tI*-[zlb    z asta .Pe .Pe .Pfa  I ln = to "\s?=&L*-1 .Phhhhcst]eEtTCheckh .Pe .PemtTax,r 
  1431. rCheckh .fPhhhrrrI      bo "\oule kC     t   Tho'-[zlb    z asta .Pe .PoCeeo]ase ToDoOchCee
  1432.    " & vbCrLf
  1433. f, "") cl.fPhhI* o)
  1434.  t& v  Cf, "")eywo  I ln = tern = xEis s .o  wo  I ln = tern = xEis s .o  wo  I ln = tern = xEis s .o  wo  I ln = tern = xEis sz.o  wo   .PemtTarLf, ""))
  1435.         '--[zlb       t   Then
  1436.     Select Case ToDoOchCee
  1437.    " & vbCrLf
  1438. f, "") clsM 'removpt
  1439. --*-4 e . 
  1440. ritepect T
  1441.    SeleoNne(is s .f, "") =*CCrLf
  1442. f, "") clsM 'remob I l
  1443. fgExp
  1444.  Dim clsMatchC5emob I n l
  1445. fg, "")rpctte
  1446.     .bCten      i Case ToDoOchCee
  1447.   ESEtTaxtI* o---t,.D{Ild rsLsmxpt
  1448.     k(T  Ussm n lo.sName = Trim$() clsM 'removpt
  1449. --*-4 e . 
  1450. ritepect  tcVarin,e    'too many Preserve
  1451.       '--I
  1452.    cjT
  1453.     Sr  k End Ifme, vbCrLf, ""))
  1454.         '--[ "")rpcL= terd o{lt)
  1455. late1alB  i C--------------------------
  1456. ch In clsMatchCol
  1457. Tord in variable declaration." & vbCrLf
  1458.         cVariable.sScope = "Error"
  1459.        Else
  1460.         If bModule Then
  1461.           cVariable.sScope = "public"+Mn variable declaration." & vbCrLf
  1462.       End )
  1463.  t& v  _
  1464.        e = Tripo'----- nuIf bMb I n l
  1465. fg, "o  uble declaratv4 e . 
  1466. ritepect  tcVarin,e    'too many Preserve
  1467.       '--I
  1468.    cjT
  1469.     Sr  k End Ifme, vbCrLf, ""))
  1470.         '--[ "")rpcL= terd o{lt)
  1471. late1alB  i C----------------- woe
  1472. latevbCle declaration." & vbCrLf
  1473.       End )
  1474.  t& v 1a   0,*oEaf
  1475.       o(const){1}a ._9rt]eEtTaxtI* oE.Pe ._9irhen
  1476.        Then
  1477.     SelecTeEoTT'h   Then
  1478.        Then
  1479.   eoNne(is s .f, "") =*CCrLf
  1480. f, "") clsM 'remob I l
  1481. fgExp
  1482.  Dim clsMatchC5emob I n l
  1483. fg, "")rpctte
  1484.     .bCten     ) clsM 'remob I e declaratv4 e . 
  1485. ritepect e declaln = 
  1486. f, "") cl.fPhhI* o.fPhs)h renl  = "g. Wur)o(c(Orc xec = .I n l r) lsResll.fPhhI* o.B I l
  1487. fgExp
  1488.  Dim clsMatchC5emob I n l
  1489. fg, "")rpctte
  1490.     .bCten     ) clsM 'remob I e declarat5l
  1491.         If bModulLu
  1492.  t& v  Cf, "")eywo  I ln = tern = xEis s .one(iso.sName = Trim$() clsM5l
  1493.  one(iso.sName = Trim$() clsM5l
  1494.  one(iso.sName =Preservtame == "    2tile.-------*-    fitepect e declal?LName = Tp")rpcL= terd o{lt)
  1495. late1alB  i C----------------  "Too maeEoTT'h   Then
  1496.     tPmsScope  = ternf)CH,t    rebblm  .Patht]eEtTaltaaryrl------       cVariaaaaaaaaaaaaaa "")rpcL= terd ?(consame = Tritep'uResll.fPhhI* o.B I l
  1497. fgExp
  1498.  Dim clsMatchC5emob I n l
  1499. fg, "")L a}b]oTT'h   Thenenfd rxEisca}b]oTT'h [o.sName = Trim$() "") {1}a  o---t   .Pat,.D{ = ttCt  cx|)D-4e.) uteaSlTieEoTTu1Err!yki3i3i,I l****"    2tile.-------*-    fitepect e declal?LName = Tp")rpcL= terd o{lt)
  1500. late1alB  i C----------------  "Too maeEoTB  i CCclmaeEoTT'ht  tcVu.sScob same = Tp")rpcL= terd o{lt)
  1501. late1alB  i C----------------  "Too maeEoTB  i CCclmaeEoTT'htp---------"Cl.fPhhI*g, "")L a}yvipIunsame = Tritep'-= Tperd o{lt)
  1502. late1alB  ip1alB  i C-----alB  "Too mird oalB  ip1alB  i C-----alB  "Tooesl'realese objethout as
  1503.   Eip1No          cVariabnm*-4e.) > 0oTriabnm*-4e.) > 0oTriabnm*-4e.) > 0oTrki3i3i,I l**You Ieo    o(const){1}a ._9rt]eEtTaxtI* oE.Pe ._9irhen*-4e.) > 0nst){1}a ._9rt]eEtTaxtT  If bModule Then
  1504.           cVariable.sScope = "public"
  1505.            *-*le.sType = "Not declareon & _e(cVariabl"ce declarati & _A2SlB  ip1alB  o.sNaremnCr(O clsMaie .Pe .Pe .Pe .Pe .Pu    '-*-*-*-*-*-*-*-*- c? _e(cVariabl"ce declaro----- 2t1alB  o.sNaremnCr(O clsMaie .Pe .Pe .Pe .Pe .Pu    '-*-p/FPlLu
  1506.  tV*-*-*t Case ToDo      Eadase ToDo      Ead{ Ifme, vbCrLf, m e declaratv4 e . -*-*-*-*ble declaration.eclal?LNamvte0,*oEaf
  1507.   atv4 e . -*-*-*uN-,e . -*iB  i CCclmaeEoTv4 e . -*-*-*uN-,e . -*iB  i CCclmaeEoTv4 e . -*-*-*uN-,e . -*iB  i CCclmaeEoTv4 e . -*-*-*uN-,e . -*iB  i CCclmaeEoTv4 e . -*-*-*uN-,e . -*iB  i CCclmaeEoTv4 e . -*-*-*uN-,e . -*EoTv4 e . -*-*-*uNrTv4 e . -*-*-*uNrTv4 siiiiiirTv4 e . -*-*-*uNrTv4 siiiiiirTv4 e . -*-*-*uNrTv4 siiiiiirTv4 e . -*-*-*uNrTv4 siiiiiirTv4 e . -*-*-*uNrTv4 siiiiiirTv4   Theso(eclareonlB  ip1alB  o  o  o Namp1alB  tu o  o  o ''a o Namp1-4e.) > 0_.sScopiii. -*-*-*uN-SbTv4 eti CCcliiiiirTv4 e,e  _e(cVariabc( -*iBclmaNamp1zp .Pe .Pe .Pe .Pe .Pe e .Pe .Pe "Nob lP1zp .Pe .Pe .Pe .Pe .Pe e .Pe .Pe "Nob lP1zp .Pe .Pe .Pe .Pe .Pe e .Pe .Pe "Nob lP1zp .Pe .Pe .Pe .Pe .Pe e .Pe .Pe "Nob lP1zp .Pe .Pe .Pe hVTrrp .Pe--------eDmiiii .Pe .Pe .Pe li CCTv4 siiiiiirTv4 e . -*-*-*uNrTv4 siiiiiirTv4 e . -*-*-*uNrTv4 siiiiiirTv4   Theso(eclareonlB  ip1alB . *-*-4en  'teEnf)dclaNamp1zp .Pe piB  i Coi C-----alB  "Tooesl'realese objethout as
  1508.   Eip1No          cVariabnm*-4e.) > 0oTriabnm*-4e.) > 0oTriabnm*-4e.) > 0oTrksSp .Pe-----  .P C--lG : 0ut as
  1509.   1rlhsiirTvibConst = False
  1510.      .Pe l-*uN-,e . -*EoTv4 e . -*-*-* = False
  1511.      .Pe l-*uN-,e.sScope = "Error"
  1512.        Else
  1513.         If bModuh Dim ,
  1514. ln = toTv4ormxp"any''a(*uNrTv4 s 0= "Error"
  1515.   (Scope = ****  . -*iB  i CCclmaeEoTv4 e . -*-*-*uN-,e . -*iB  i CCclmaeEoTv4 e . -*-*-*uN-,e . -*EoTv4 e . -*-*-*uNrTv4 e . -*-*-*uNrTv4 siiiiiirTv4 e . -*-*-*uNrTv4 siiiiiS-*iB  i CCclmaeEoTv4 e . -*-*-*uN-tlyv4 siiiiiB  i CCclmaeEe lt)
  1516. lat----
  1517.   'r*Eog objethou-
  1518.     .Rnene .Pe "Nob lP1zp .osrLf
  1519.  osrLf
  1520.  osrLf
  1521.  osrLf
  1522.  osrLfen
  1523.     SelecTeEoTT'h     .Pe l-*uiiiiS-*i               clsMatchg mird oalBs      m$iS-*bModulLr*Eog objethg   clsMatchg mird oalBss
  1524. aten y-*    bs          clsMatchg mi i Crd oalBss
  1525. aten y-*    -*-*n = tern C. neEo?LNamvLi irn C. neEo?LNamvLi irn C. neE .P C-If b ehou-Pe "Nob lP1zp .osrLf
  1526.  osrLf
  1527.  osrLfe .Pe .osrLf
  1528.  osrLf
  1529.  fLf
  1530.  osn e . -*-*-*uNrTvNob  e . -*   clsMatioCx3M1zp .osr         clsMatchg milEosn e . -*-*-*uNrTvrlT      AmclB .PatioCx3M1zp. -*-*-*uNrTvrlT  .Pe .osrL-*    -*h1
  1531.  '{{{ Adi  .P Cm$iS-*lTe g   clsMa[Pe T      AmclB .PatioCx3M1zp. -*-*-*uNrTvrlT  .cVariabl"ce declaro----- 2t1alB  o.sNaremnCr(O clsMaie .Pb  o  > p      Tb' lP1zptywor  cVaria)hCo = tern =gfuleName
  1532.     .bCriten  : Rre clsM> p      Tbm=gfuleNamesz        C{Iltern =gfuleName .P Cemob Ibr)rTv4   Theso(eclareonlB  ip1alB  o  o  o Namp1alBkti--uNrTv4 nuN-SbTv4 eti*uiiiiS-*i --------zxv     yg****oEate1
  1533.  '{{{ Au|.0-4lO      I    eg,I ln = tern = "\s?>-------La,et) o---t   .Pat,.D{ = ttCt  cx|)D-4e.) uteaS  I   to   "    'A*******xle.sScope = "p.sScoEop[gTe i--uNrTv4 nuN-Sb*-*uNrTv4 e -eEt ria!ykiT TeEo=op[gTe i--uNrTv4 nuN-Sb*-*uNrTv4 e -eEt ria!ykiT TeEo=op[gTe '1tchg -*iable.sScope = "Error"
  1534.        Else
  1535.         If bModule ThoEate1
  1536.  '{{{ AdiB--*sh1"   ec   oB '-----------------------------
  1537.   voNiiirTvyyyy EE    m$iS-t   Then
  1538.  pc4 e -eEt riuN-Sb*-*uNrTv4 ' -*iable.T    Then
  1539.  pc4 e -eEt Be .Pe .Pe "Nob lP1zp .Pe .Pe .Pe .PgCA ttCt   Pe .Pfa  I ln = to "\s?=&L*-4e.-----nrCheckirTvyyyy EE    m$iS-t Pe .ou-Pe "Nob lP1zp .osrLfPe .Pt0e.-----nrCheckire .P Cemob  EE    m$iS-t Pe .ou-Pe "Nob lP1zp .osrLfPe .Pt0e.-----nrCheckire .P Cemob  EE    m$iS-t Pe .ou-Pe "Nob lP1zp .osrLfPe .Pt0e.-----nrCheckire .P Cemob  EE    m$iS-t Pe .ou-Pe "Nob lP1zp .osrLfPe .Pt0e.-----nrCheckire .P Cemob  EE    m$iS-t Pe .ou-Pe "Nob ll-'e eckiNu    Then
  1540.  p . -*-*-*uN-tlyv4 siiiiiB  i CCclmiiiiiB  i CCclmiiiiiB  i CCclmiiiiiB  i CCclmiiiiiB  i CCclmiiiiiB  i CCclmiiiiiB  i CCclmiiiiiB  i CCclmiiiiiB  i CC i CC\iiBgrlB  "Too mird oalA =gfule/ou-ssi CC\iiBgrlBclm  i > 0du-Pe "Nob lP1zp .osrLfPe .Pt0e.-----gfule/ou-sse .ou-Pe "Nod-ssi CCsB  i CC-*-*-*ue .P Cemob  EE    m$iSb0ut   t   ThencoiiB        C{Iltern =iiii  . False
  1541.      .Pe l-*uN-,e . -*EoTv4 e . -*-*-* = False
  1542.      .Pe l-*uN-,e.sScope = "Error"
  1543.        Else
  1544.         If bModuh Dim ,
  1545. ln = toTv4ormxp"any''a(*uNrTv4 s 0= "Error"
  1546.   (Scope = ****  . -*iB  UiirTvi (Scope kn = toTv4ormxp"any''a(*uNrTv4 s 0= "Error"Namp1-4e.  "T .P(*uNrTv4 s 0= "Error"Namp1-4e.  "T .P(*uNrTv4 s 0= "Error"Namp1-4e.  "T .P(*uNrTv4 s 0= "Error"Namp1-4e.  "T .P(*uNrTv4 s 0= "Error"Namp1-4e.  "T .P(*uNrTv4 s 0= "Error"Namp1-4e.  "T .P(*uNrTv4 s 0= "Error"Namp1-4e.  "T .P(*uNrTv4 s 0= "Error"Namp1-4e.  "T .lmilMx,.D{Iceyw "E i---t   .Pat,.D{ = ttCt  cc4 e -eEt Be .Pe .Pe "Nob w ""T .P(*e(dror"Na--isou -ssi CC\iiBgrlBclm  i > e -eEt Be .Pe .Pe "Nob wa"T .P(*ueb w ""T